From: Kim F. Storm Date: Mon, 9 Sep 2002 22:33:36 +0000 (+0000) Subject: (Fdiscard_input): If defining keyboard macro, X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~30707 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=b91c70e88a20b2b5ab1344c322e7ee91d9e5722c;p=emacs.git (Fdiscard_input): If defining keyboard macro, end and save it instead of discarding it. --- diff --git a/src/keyboard.c b/src/keyboard.c index 1f2227f419a..76101090d4c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -9786,10 +9786,16 @@ If FILE is nil, close any open dribble file. */) DEFUN ("discard-input", Fdiscard_input, Sdiscard_input, 0, 0, 0, doc: /* Discard the contents of the terminal input buffer. -Also cancel any kbd macro being defined. */) +Also end any kbd macro being defined. */) () { - current_kboard->defining_kbd_macro = Qnil; + if (!NILP (current_kboard->defining_kbd_macro)) + { + /* Discard the last command from the macro. */ + Fcancel_kbd_macro_events (); + end_kbd_macro (); + } + update_mode_lines++; Vunread_command_events = Qnil;